package labs.laba_02;

import java.util.ArrayList;

public class TVsManager {
	private ArrayList<TV> tvList = new ArrayList<TV>();
	private byte currentTV = -1;

	public void addTV(){
		TV ntv = new TV();
		tvList.add(ntv);
	}
	public boolean delTV(byte i){
		if(tvList.size()>=i){
			tvList.remove((int)i);
			if(currentTV==i){
				currentTV=0;
			}
			return true;
		}
		return false;
	}
	public byte getCurrentTVIndex(){
		return currentTV;
	}
	public boolean setCurrentTVIndex(byte i){
		if(0<i && tvList.size()>=i){
			currentTV = i;
			return true;
		}
		return false;
	}
	public TV getTV(byte i){
		return tvList.get(i);
	}
	public ArrayList<TV> getTVList(){
		return (ArrayList<TV>)tvList;
	}
}
